package com.huowenjie.entity;

import lombok.Data;

import javax.persistence.*;

@Table(name = "jpa_goods")
@Entity
@Data
public class Goods {
    @Column(name = "id")
    @Id
    private Long id;

    @Column(name = "gname")
    private String gname;

    @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.EAGER)
    @JoinColumn(name = "brandid",referencedColumnName = "id",insertable = false,updatable = false)
    private Brand brand;

}
